<template>
	<view class="page">
		<CustomNav :isBack="true" color="#fff" :topBgColor="topBgColor" :title="title"></CustomNav>
		<view class="info-block" :style="'margin-top:'+mt">
			<image :src="img" mode="widthFix" class="img" :show-menu-by-longpress="true" @click="previewImage"></image>
			<view class="text-item">
				<view class="text">请将二维码保存至手机相册</view>
				<view class="text">然后长按识别进入该公众号</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: '',
				title: '二维码'
			}
		},
		methods: {
			previewImage(e) {
				uni.previewImage({
					// 需要预览的图片链接列表。若无需预览，可以注释urls
					urls: [e.target.src],
					// 为当前显示图片的链接/索引值
					current: e.target.src,
					// 图片指示器样式	
					indicator: 'default',
					// 是否可循环预览
					loop: false,
					// 长按图片显示操作菜单，如不填默认为保存相册
					// longPressActions:{
					// 	itemList:[this.l('发送给朋友'),this.l]
					// },
				});
			},
		},
		onLoad(e) {
			this.img = e.img
			this.title = e.title
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		overflow: hidden;
		height: 100%;
		background-image: linear-gradient(to bottom, #68C759, #F8F8F8 400px, #F8F8F8 400px, #F8F8F8);
		background-repeat: no-repeat;

		.info-block {
			background-color: #fff;
			width: $content-width;
			height: 70vh;
			margin: 0 auto;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			border-radius: 30rpx;

			.img {
				width: 70%;
			}

			.text-item {
				margin-top: 60rpx;
				font-size: 30rpx;

				.text {
					margin-top: 20rpx;
				}
			}
		}
	}
</style>